package web.weibo.model;

import java.util.ArrayList;

public class User {
    public int id;
    public String note;
    public String username;
    public String password;
    public UserRole role;
    public String salt;
    public String avator;
    public ArrayList<Weibo> weibos;
    public ArrayList<Comment> comments;

    public User(int id, String note, String username, String password, UserRole role, String salt, String avator) {
        this.id = id;
        this.note = note;
        this.username = username;
        this.password = password;
        this.role = role;
        this.salt = salt;
        this.avator = avator;
    }

    public User(){}

    @Override
    public String toString() {
        String s = String.format(
                "(用户Id: %s, 用户名: %s, 账号: %s, 密码: %s, 权限: %s, 盐: %s, 头像: %s)",
                this.id,
                this.note,
                this.username,
                this.password,
                this.role,
                this.salt,
                this.avator
        );
        return s;
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public UserRole getRole() {
        return role;
    }

    public void setRole(UserRole role) {
        this.role = role;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getAvator() {
        return avator;
    }

    public void setAvator(String avator) {
        this.avator = avator;
    }

    public ArrayList<Weibo> getWeibos() {
        return weibos;
    }

    public void setWeibos(ArrayList<Weibo> weibos) {
        this.weibos = weibos;
    }

    public ArrayList<Comment> getComments() {
        return comments;
    }

    public void setComments(ArrayList<Comment> comments) {
        this.comments = comments;
    }
}
